import _ from "lodash";
import "./style.css";
import YKimg from "./YKjun.jpg";
import dataJson from "./data.json";

console.log(dataJson);

function component() {
  const element = document.createElement("div");

  element.innerHTML = _.join(["Hello", "webpack"], " ");

  element.classList.add("yk");

  // 添加图片
  const img = new Image();
  img.src = YKimg;

  element.appendChild(img);

  return element;
}

document.body.appendChild(component());

const btn = document.createElement("button");
btn.innerText = "点我加载一个小模块";
btn.onclick = async () => {
  const { bar } = await import("./bar.js");
  console.log(bar);
};

document.body.append(btn);
